<template>
  <el-table
    :data="tableData"
    style="width: 100%"
    :default-sort = "{prop: 'date', order: 'descending'}"
    >
    <el-table-column
      prop="date"
      label="日期"
      sortable
      width="180">
    </el-table-column>
    <el-table-column
      prop="name"
      label="姓名"
      sortable
      width="180">
    </el-table-column>
    <el-table-column
      prop="logs"
      label="详细"
      :formatter="formatter">
    </el-table-column>
  </el-table>
</template>

<script>
  export default {
    data() {
      return {
        tableData: [{
          date: '2022-04-16 17:16:48',
          name: '张三',
          address: '日志事例4'
        }, {
          date: '2022-04-16 16:27:48',
          name: '张三',
          address: '日志事例3'
        }, {
          date: '2022-04-16 16:23:48',
          name: '李四',
          address: '日志事例2'
        }, {
          date: '2022-04-16 16:21:48',
          name: '张三',
          address: '日志事例1'
        }]
      }
    },
    methods: {
      formatter(row) {
        return row.address;
      }
    }
  }
</script>
